#include "stdio.h"

int function(int x)
{  	  	 	 	 	 
    if (x == 1)
        return 1;
    else if (x > 1)
        return function(x - 1) + 4 * x - 4;
    else
        return -1;
}  	  	 	 	 	 

int main(void)
{  	  	 	 	 	 
    int x;
    int cell_num;

    do
    {  	  	 	 	 	 
        scanf("%d", &x);
    } while (!(x > 0 && x <= 10));

    if ((cell_num = function (x)) > 0)
        printf("%d", cell_num);
    return 0;
}  	  	 